#
#  Copyright (c) 2010 RICOH Co. Ltd. All rights reserved.
#
USE_SHLIBDIR=	yes

NOMAN=
NOPROFILE=
GWIPC_TOPDIR=../..
TARGETDIR  = ${TOPDIR}/gwpf_base/destdir/usr/lib
LIBNAME    = libgwipc_socket.a

.PATH:  ${GWIPC_TOPDIR}/src/libgwipc
.PATH:  ${GWIPC_TOPDIR}/src/itron
.PATH:  ${GWIPC_TOPDIR}/src/mprintf

LIB=	gwipc_socket

SRCS=	gwipc_socksrv.c gwipc_socksvrun.c gwipc_socksvh.c gwipc_sockcli.c \
gwipc_sockcmn.c gwipc_svmqueue.c gwipc_timer.c \
itron_sem.c itron_flg.c itron_mbx.c \
mprintf.c mprint_pthread.c

CPPFLAGS+= -DGWIPC_USE_SOCKET
CPPFLAGS+= -DUSE_WITH_PTL -DNO_SIZE_CHECK -DNEED_SIZE_CHECK_WARN
CPPFLAGS+= -I${GWIPC_TOPDIR}/src/itron -I${GWIPC_TOPDIR}/src/libgwipc

CFLAGS+= -I${TOPDIR}/gwpf_base/destdir/usr/include/
CFLAGS+= -g -O2

CFLAGS+=-Wall
CFLAGS+=-Wimplicit
CFLAGS+=-Wreturn-type
CFLAGS+=-Wswitch
CFLAGS+=-Wcomment
CFLAGS+=-Wtrigraphs
CFLAGS+=-Wuninitialized
CFLAGS+=-Wpointer-arith
CFLAGS+=-Wcast-qual
CFLAGS+=-Wwrite-strings
CFLAGS+=-Wunused

.if defined(GWIPC_STATISTICS)
CFLAGS+= -DGWIPC_STATISTICS
SRCS+= gwipc_statistic.c
.endif

.if defined(GWIPC_ITRON_DUMP)
CFLAGS+= -DGWIPC_ITRON_DUMP
SRCS+= itron_sem_dump.c itron_flg_dump.c itron_mbx_dump.c
.endif

SRCS+= gwipc_sig.c

.include <bsd.lib.mk>

TARGETS=	${LIBNAME}
all: ${TARGETS}
	@ cp -fp ${LIBNAME} ${TARGETDIR}

clean:
	@ rm -f ${TARGETDIR}/${LIBNAME}
